package reliability.ui;

import javax.swing.*;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.text.ParseException;

public class ResultField
    extends JTextField
{
    private static final int COLUMNS = 22;

    public ResultField()
    {
        super(COLUMNS);

        setCursor(new Cursor(Cursor.TEXT_CURSOR));
    }

    protected void processKeyEvent(KeyEvent e)
    {
        if (e.getID() == KeyEvent.KEY_TYPED)
        {
            return;
        }
        super.processKeyEvent(e);
    }

    protected void processFocusEvent(FocusEvent focusEvent)
    {
        if (focusEvent.getID() == FocusEvent.FOCUS_GAINED)
        {
            selectAll();
        }
        super.processFocusEvent(focusEvent);
    }

}
